<script type='text/javascript'>
function view_applicants(fields, filters, filters_or, additional_code) {
	var div = document.createElement('DIV');
	var html = "";
	html += "<form name='view_applicants' action='<?php echo $_SESSION["root_url"]?>/applicants.php' method='post'>";
	for (var field in fields) {
		var field_name = 'field__'+field.replace(/\./g,"$").replace(/\#/g,"$");
		html += "<input type='hidden' name='"+field_name+"' value='1'/>";
		if (fields[field] == true)
			html += "<input type='hidden' name='"+field_name+"__edit' value='1'/>";
	}
	var filter_counter = 0;
	var filters_ids = new Object();
	for (var field in filters) {
		var field_name = 'field__'+field.replace(/\./g,"$").replace(/\#/g,"$").replace(/\//g,"$");
		var id = filter_counter++;
		html += "<input type='hidden' name='filter_"+id+"' value=\""+field_name+filters[field]+"\"/>";
		filters_ids[field] = id;
	}
	if (filters_or != null) {
		for (var field_or in filters_or) {
			var linked = filters_or[field_or];
			if (filters_ids[field_or] != null && filters_ids[linked] != null)
				html += "<input type='hidden' name='or_filter_"+filters_ids[field_or]+"' value='"+filters_ids[linked]+"'/>";
		}
	}
	if (additional_code != null) {
		html += "<input type='hidden' name='additional_code' value=\""+additional_code+"\"/>";
	}
	html += "</form>";
	div.innerHTML = html;
	document.body.appendChild(div);
	document.forms["view_applicants"].submit();
}
</script>